package com.sm.li.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.sm.li.common.valid.anno.Regular;
import com.sm.li.common.valid.group.*;
import com.sm.li.entity.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author 李
 * @since 2021-06-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_menu")
@ApiModel(value = "Menu对象", description = "")
public class Menu extends BaseEntity {

    private static final long serialVersionUID = 1L;

//    @ApiModelProperty(value = "权限id")
//    private Long id;

    @NotBlank(message = "权限名称不能为空", groups = {MenuGroup.class, DirectoryGroup.class, BtnGroup.class})
    @ApiModelProperty(value = "权限名称")
    private String menuTitle;

    @NotNull(message = "权限父id不能为空", groups = {MenuGroup.class, DirectoryGroup.class, BtnGroup.class})
    @ApiModelProperty(value = "权限父id")
    private Long parentId;

    @NotNull(message = "权限类型不能为空", groups = {MenuGroup.class, DirectoryGroup.class, BtnGroup.class})
    @Regular(message = "只能取值1 2 3", values = {1, 2, 3}, groups = {MenuGroup.class, DirectoryGroup.class, BtnGroup.class})
    @ApiModelProperty(value = "1:表示目录 2：表示菜单 3：表示按钮")
    private Integer menuType;

    @NotNull(message = "权限排序不能为空", groups = {MenuGroup.class, DirectoryGroup.class, BtnGroup.class})
    @ApiModelProperty(value = "权限排序")
    private Integer sort;

    @NotBlank(message = "路由地址不能为空", groups = {MenuGroup.class, DirectoryGroup.class})
    @ApiModelProperty(value = "路由地址")
    private String menuRouter;

    @NotBlank(message = "菜单图标不能为空", groups = {MenuGroup.class, DirectoryGroup.class})
    @ApiModelProperty(value = "菜单图标")
    private String menuIcon;

    @NotBlank(message = "组件地址不能为空", groups = {MenuGroup.class})
    @ApiModelProperty(value = "组件地址")
    private String componentPath;

    @NotBlank(message = "组件名称不能为空", groups = {MenuGroup.class})
    @ApiModelProperty(value = "组件名称")
    private String componentName;

    @NotBlank(message = "权限标识不能为空", groups = {MenuGroup.class, BtnGroup.class})
    @ApiModelProperty(value = "权限标识")
    private String permSign;

//    @ApiModelProperty(value = "创建者id")
//    private Long createBy;
//
//    @ApiModelProperty(value = "创建时间")
//    private LocalDateTime createTime;
//
//    @ApiModelProperty(value = "修改者")
//    private Long updateBy;
//
//    @ApiModelProperty(value = "修改时间")
//    private LocalDateTime updateTime;


}
